set(SRVL_VERSION_FILE "${CMAKE_SOURCE_DIR}/modules/core/include/srvl/core/version.hpp")
file(STRINGS "${SRVL_VERSION_FILE}" SRVL_VERSION_PARTS REGEX "#define SRVL_VERSION_[A-Z]+[ ]+" )

string(REGEX REPLACE ".+SRVL_VERSION_MAJOR[ ]+([0-9]+).*" "\\1" SRVL_VERSION_MAJOR "${SRVL_VERSION_PARTS}")
string(REGEX REPLACE ".+SRVL_VERSION_MINOR[ ]+([0-9]+).*" "\\1" SRVL_VERSION_MINOR "${SRVL_VERSION_PARTS}")
string(REGEX REPLACE ".+SRVL_VERSION_PATCH[ ]+([0-9]+).*" "\\1" SRVL_VERSION_PATCH "${SRVL_VERSION_PARTS}")
string(REGEX REPLACE ".+SRVL_VERSION_STATUS[ ]+\"([^\"]*)\".*" "\\1" SRVL_VERSION_STATUS "${SRVL_VERSION_PARTS}")

set(SRVL_VERSION_PLAIN "${SRVL_VERSION_MAJOR}.${SRVL_VERSION_MINOR}.${SRVL_VERSION_PATCH}")
set(SRVL_VERSION "${SRVL_VERSION_PLAIN}${SRVL_VERSION_STATUS}")
